<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 删列造序 -->
    <script>
      var minDeletionSize = function (A) {
        let n = A[0].length
        let res = 0
        for (let i = 0; i < n; i++) {
          for (let j = 0; j < A.length - 1; j++) {
            // 因为题目叫我们执行完删除后留下非降序的，那么只要出现降序则是需要删掉的，
            // console.log(A[j][i])
            // console.log(A[j+1][i])
            if (A[j][i] > A[j + 1][i]) {
              res++
              break
            }
          }
        }
        return res
      }
      console.log(minDeletionSize(['cba', 'daf', 'ghi']))
    </script>
  </body>
</html>
